package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.Menu;
import com.itheima.pojo.Role;
import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface MenuDao {

    public User findUser(String username);

    //根据用户id查找对应的角色
    public Set<Role> findRolesByUserId(Integer userId);

    //根据角色查出所对应的菜单项
    public List<Menu> findMenuByRoleId(Integer roleId);

    //进行null判断,查询父菜单
    public List<Menu> findParentMenuByRoleId(@Param("id") Integer roleId);

    //分页查询
    public Page<Menu> findPage(String queryString);

    //添加菜单
    public void addMenu(Menu menu);

    //编辑菜单
    public void editMenu(Menu menu);

    //删除菜单
    public void deleteMenu(Integer id);

    //回显菜单
    public Menu findById(Integer id);

}
